<%@page import="Model.User.UserSupplierPurchaseView"%>
<%@page import="Model.Purchase.PurchaseOfferList"%>
<%@page import="Model.Business.BusinessClass"%>
<%@page import="Model.User.UserList"%>
<%@page import="Model.Supplier.SupplierList"%>
<%@page import="RssEasy.Core.CookieHelper"%>
<%@page import="Model.Purchase.PurchaseList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    CookieHelper cookie = new CookieHelper(request, response);
    String cook = cookie.Get("myid");
    UserList user = new UserList(pageContext);
    user.select().where("myid="+cook+"").get_first_rows();
    SupplierList su = new SupplierList(pageContext);
    su.select().where("myid="+cook+"").get_first_rows();
    BusinessClass bc = new BusinessClass(pageContext);
    bc.select("id,parentid,category").where("parentid=?", "0").query();
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>企企通-企业名片</title>
        <meta name="description" content="这里写网站内容描述" />
        <meta name="keywords" content="这里写关键词" />
        <meta name="Robots" contect="all">
        <link href="/css/reset.css" rel="stylesheet" type="text/css" />
        <link href="/css/layout.css" rel="stylesheet" type="text/css" />
        <link href="/css/swfupload.css" rel="stylesheet" type="text/css"/>
        <link href="css/vcard.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <h2 id="title">企业名片</h2>
        <div id="box">
            <form id="form">
                <h3>
                    企业信息详情
                    <button id="cancel" type="button">取消</button>
                    <button id="save" type="button">保存</button>
                    <button id="edit" type="button">编辑</button>
                </h3>
                <div id="details">
                    <div id="show">
                        <div>
                            <h4><%user.write("corpname");%></h4>
                            <p><%su.write("englishname");%></p>
                            <p attr="<%su.write("attr");%>"></p> 
                            <img src="/upfile/<%su.write("logo");%>"alt="企业logo"/>
                        </div>
                        <table>
                            <tr>
                                <td>主营类别：</td>
                                <td><p><%user.write("mainbusiness");%></p></td>
                            </tr>
                            <tr>
                                <td>企业地址：</td>
<!--                                <td><p area="" dict-split="&nbsp;"></p></td>-->
                                <td><p><%user.write("fulladress");%></p></td>
                            </tr>
                            <tr>
                                <td>联系人：</td>
                                <td><p><%user.write("linkname");%></p></td>
                            </tr>
                            <tr>
                                <td>联系电话：</td>
                                <td><p><%user.write("telphone");%></p></td>
                            </tr>
                        </table>
                    </div>
                            
                    <div id="info">
                        <div>
                            <h4><%user.write("corpname");%></h4>
                            <p><%su.write("englishname");%></p>
                            <select name="attr">
                                <option attr="<%su.write("attr");%>" value="<%su.write("attr");%>">国营企业</option>
                                <option value="1">国营企业</option>
                                <option value="2">外资企业</option>
                                <option value="3">中外合资企业</option>
                                <option value="4">私营企业</option>
                            </select>
                            <ul id="icourlwrap" class="swfuploadwrap">
                                <li><div class="swfuploadimg"><div><img src="" alt="上传企业logo"></div></div></li>
                            </ul>
                            <div>
                                <span swfupload="icourlswf" config="{multimode:0,fileType: [['图形图像(*.jpg;*.png;*jpeg)','*.jpg;*.png;*jpeg']]}"></span>
                            </div>
                            <input type="hidden" id="ico"  name="logo" value="<%su.write("logo");%>" />
                        </div>
                        <table>
                            <tr>
                                <td>主营类别：</td>
                                 <input id="mainproducts" type="hidden" value="<%user.write("mainbusiness");%>">
                                <td id="main_class">
                                <select id="one">
                                    <option>请选择</option>
                                    <% while (bc.for_in_rows()) {%>
                                    <option value="<%=bc.get("id")%>"><%=bc.get("category")%></option>
                                    <% }%>
                                </select>
                                <select id="two">
                                    <option>请选择</option>
                                </select>
                            </td>
                            </tr>
                            <tr>
                            <td></td>
                            <td>
                                <div id="mainClass">
                                </div>
                            </td>
                        </tr>
                            <tr>
                                <td>企业地址：</td>
                                <td><input type="text" name="fulladress" value="<%user.write("fulladress");%>" id=""/><label for=""></label></td>
<!--                                <td><select id="province" name="shengid" class="site"><option area="" value ="">请选择</option></select><select id="city" name="shiid" class="site"><option  area="" value ="">请选择</option></select><select id="district" name="xianid" class="site"><option area="" value ="">请选择</option></select></td>-->
                            </tr>
                            <tr>
                                <td>联系人：</td>
                                <td><input type="text" name="linkname" value="<%user.write("linkname");%>" id=""/><label for=""></label></td>
                            </tr>
                            <tr>
                                <td>联系电话：</td>
                                <td><input type="text" name="telphone" value="<%user.write("telphone");%>" id=""/><label for=""></label></td>
                            </tr>
                        </table>
                    </div>
                    <div id="accumulate">
                        <h5>累计交易金额</h5>
                        <%
                            UserSupplierPurchaseView uspv = new UserSupplierPurchaseView(pageContext);
                            String aggregate="";
                            String num="";
                            if(uspv.select("num,aggregate").where("myid="+cook+"").get_first_rows()){
                            aggregate = uspv.get("aggregate");
                            num = uspv.get("num");
                            }
                        %>
                        <p><span><%=aggregate%></span>元</p>
                        <b>累计交易金额=已归档所有采购项目+订单金额</b>
                        <div></div>
                        <h5>累计项目数量</h5>
                        <p><span><%=num%></span>个</p>
                        <b>累计项目数量=供应商参与过报价的项目总量</b>
                    </div>
                </div>
            </form>
        </div>
        <%@include file="/inc/js_all.html" %>
        <script src="js/upload.js" type="text/javascript"></script>
        <script src="/js/arealist.js" type="text/javascript"></script>
        <script src="/data/dictdata.js" type="text/javascript"></script>
        <script src="js/vcard.js" type="text/javascript"></script>
    </body>
</html>
